# -*- coding: utf-8 -*-
''''
进行mysql数据操作
'''
import pymysql.cursors

# Connect to the database
connection = pymysql.connect(
    host='10.10.4.29',
    port=3306,
    user='root',
    password='FGAoRw0f',
    db='p_ttsp1',
    charset='utf8',
    cursorclass=pymysql.cursors.DictCursor)

with connection.cursor() as cursor:
    # Create a new record
    sql = "select * from p_transaction"
    cursor.execute(sql)
    for row in cursor.fetchall():
        print('共查找出',row['acc_no'])


# your changes.
connection.close()

